/*
 * @Author: your name
 * @Date: 2019-09-05 14:57:12
 * @LastEditTime: 2021-03-02 13:12:45
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \HMI\src\api\userinfo.js
 */
import http from "@/config/http.js"

export default {
	async adduser(data) {
		try {
			let res = await http.post("/api/user/save", data)
			return res
		} catch (err) {
			alert('请求出错！')
		}
	},
	
	//查看全部用户信息
	async findUserall(data) {
		try {
			let res = await http.post("/api/user/findAll", data)
			return res
		} catch (err) {
			alert('请求出错！')
		}
	},
	
	//编辑用户
	async edituser(data) {
		try {
			let res = await http.post("/api/user/update", data)
			return res
		} catch (err) {
			alert('请求出错！')
		}
	},
	//查看个人信息
	async getuserinfo(data) {
		try {
			let res = await http.post("/api/user/findAll", data)
			return res.data
		} catch (err) {
			alert('请求出错！')
		}
	},

	//树状
	async gettree() {
		try {
			let data = {
				code: 0,
				data: {},
				extraMsg: '',
				msg: ''
			}
			let res = await http.post("pro/findTree", data)
			return res
		} catch (err) {
			alert('请求出错！')
		}
	},
}
